package org.jiuling.wechat.officialaccount.model.adapter;

import org.jiuling.wechat.officialaccount.enums.ReceiveMessageTypeEnum;

import javax.xml.bind.annotation.adapters.XmlAdapter;

/**
 * 接受消息类型适配器
 * @author 紫灵
 * @date 2024年11月29日 20时13分07秒
 */
public class ReceiveMessageTypeAdapter extends XmlAdapter<String, ReceiveMessageTypeEnum> {
    @Override
    public ReceiveMessageTypeEnum unmarshal(String s) {
        return ReceiveMessageTypeEnum.fromValue(s);
    }

    @Override
    public String marshal(ReceiveMessageTypeEnum receiveMessageTypeEnum) {
        return receiveMessageTypeEnum.getValue();
    }
}
